package com.example.kotlin

// 定义一个数据类 User
data class User(val name: String, val age: Int)

// 定义一个数据类 Address
data class Address2(val street: String, val city: String)

// 定义一个辅助类 UserHelper
class UserHelper {
    fun printUser(user: User) {
        println("User(name=${user.name}, age=${user.age})")
    }

    fun printAddress(address: Address2) {
        println("Address(street=${address.street}, city=${address.city})")
    }
}

fun main() {
    val user = User("John Doe", 28)
    val address = Address2("Baker Street", "London")
    val helper = UserHelper()

    helper.printUser(user)      // 输出：User(name=John Doe, age=28)
    helper.printAddress(address)  // 输出：Address(street=Baker Street, city=London)
}
